package com.example.basicdemo.model.builder;

import com.isyscore.os.dev.api.IsyscoreRequestBuilder;
import com.isyscore.os.dev.util.IsyscoreHashMap;
import com.isyscore.os.dev.util.RequestUtils;

import javax.servlet.http.HttpServletRequest;

public class OsLoginRequestBuilder extends IsyscoreRequestBuilder {
    private IsyscoreHashMap headers;

    private String loginName;

    private String password;

    public String getLoginName() {
        return loginName;
    }

    public OsLoginRequestBuilder setLoginName(String loginName) {
        this.loginName = loginName;
        return this;
    }

    public String getPassword() {
        return password;
    }

    public OsLoginRequestBuilder setPassword(String password) {
        this.password = password;
        return this;
    }

    public IsyscoreHashMap getHeaders() {
        return headers;
    }

    public OsLoginRequestBuilder setHeaders(IsyscoreHashMap headers) {
        this.headers = headers;
        return this;
    }

    @Override
    public boolean validate() {
        return true;
    }

    @Override
    public IsyscoreRequestBuilder setRequestHeader(HttpServletRequest request) {
        this.headers = RequestUtils.getRequestHeader(request);
        return this;
    }
}
